package synapsolution;

public abstract class Network implements Comparable<Network> {

    private int fitness = Integer.MAX_VALUE; // Fitness reflects amount of errors. Lower is better.

    abstract int fitness();

    abstract int process(int n);

    @Override
    public int compareTo(Network n) {
        return getFitness() - n.getFitness();
    }

    public int getFitness() {
        if (fitness == Integer.MAX_VALUE) fitness = fitness();
        return fitness;
    }
}
